<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <link rel="icon" href="img/favicon.ico">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="layui/css/layui.css">
    <link rel="stylesheet" href="css/reset.css">
    <link rel="stylesheet" href="css/vendor.min.css">
    <link rel="stylesheet" href="css/plugins.min.css">
    <link rel="stylesheet" href="css/style.min.css">
    <style>
        .pwdetable-box {
            margin-top: 40px;
            padding: 0px 30px;
        }
        .pwde-table {
            width: 100%;
            text-align: center;
            border: solid 1px black;
        }
        .pwde-tr {
            background-color: #006fb7;
        }
        .pwde-table tr, td, th {
            height: 50px;
            border: solid 1px black;
        }
        html{
            height: 100%;
            overflow-y: hidden;
        }
        body{
            height: 100%;
            overflow-y: auto;
        }
        .aaa{
            padding:0 15px;height:35px;line-height:32px;font-size:14px;text-transform:uppercase
        }
    </style>
</head>
<body>

<div class="container">
    <div class="row">
        <div class="col-lg-6">
            <div class="single-product-img position-relative h-100">
                <div class="swiper-container single-product-slider" id="pic_box">
                    <div class="swiper-wrapper">
                        <div class="swiper-slide">
                            <a class="single-img gallery-popup page" id="pic_bac01">
                                <img class="img-full" src="" style="width: 490px;height: 330px;" id="pic_bac02">
                            </a>
                        </div>
                    </div>
                    <div class="swiper-pagination"></div>
                </div>
                <div class="col-12 order-lg-2 order-1 pt-10 pt-lg-0">
                    <div class="swiper-container single-product-thumbs">
                    </div>
                </div>
            </div>
        </div>
        <div class="col-lg-6">
            <div class="product-thumb-with-content row">
                <div class="col-12 order-lg-1 order-2 pt-10 pt-lg-0">
                    <div class="single-product-content">
                        <h2 class="title">WIFI网络</h2>
                        <p class="short-desc mb-6" id="detail">此商品的详情介绍</p>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div style="margin-top: 40px;">
        <caption><h5>字头号码可编辑短信<span id="content"></span>发送到<span id="number"></span></h5></caption>
        <table class="pwde-table">
            <thead>
                <tr class="pwde-tr" style="color: white;">
                    <th width="33%">套餐</th>
                    <th>卡（基普）</th>
                    <th width="33%">小时数</th>
                </tr>
            </thead>
            <tbody id="test">

            </tbody>
        </table>
    </div>
    <div style="margin-top: 40px;">
        <caption><h5>通过刮刮卡购买套餐</h5></caption>
        <table class="pwde-table">
            <thead>
                <tr class="pwde-tr" style="color: white;">
                    <th width="33%">卡（基普）</th>
                    <th>小时数</th>
                    <th width="33%">天</th>
                </tr>
            </thead>
            <tbody id="test2">

            </tbody>
        </table>
    </div>
</div>
<div class="product-tab-area section-space-top-100" style="padding-bottom: 50px;">
    <div class="container">
        <div class="row">
            <div class="col-lg-12">
                <ul class="nav product-tab-nav product-tab-style-2" role="tablist">
                    <li class="nav-item" role="presentation">
                        <a class="active btn aaa" id="description-tab" data-bs-toggle="tab" href="#description" role="tab" aria-controls="description" aria-selected="true">
                            如何使用
                        </a>
                    </li>
                </ul>
                <div class="tab-content product-tab-content">
                    <div class="tab-pane fade show active" id="description" role="tabpanel" aria-labelledby="description-tab">
                        <div class="product-description-body">
                            <p class="short-desc mb-0" id="toUse"></p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script src="js/vendor.min.js"></script>
<script src="js/plugins.min.js"></script>
<script src="js/main.min.js"></script>
<script src="layui/layui.js"></script>
<script src="js/token.js"></script>
<script src="js/config.js"></script>
<script src="js/jquery.i18n.min.js"></script>
<script src="js/multi_lang_config.js"></script>
<script>

    var layer = layui.layer;
    var form = layui.form;

    var moduleName = "subMain";
    var defaultLang = layui.data('langTab').langType;
    initLangConfig({
        defaultLang:defaultLang,
        filePath: "js/i18n/"+moduleName+"/",
        module:moduleName,
        base:"js/"
    })
    var i18np = null;
    function changeLang(lang) {
        defaultLang = lang;
        reloadI18n({
            defaultLang:lang,
            filePath: "js/i18n/"+moduleName+"/",
            module:moduleName,
        })
        i18np.loadProperties(moduleName);
        wifiDataInit();
    }

    layui.config({base: 'js/'})
        // 继承treetable.js插件
        .extend({i18np: 'i18n'}).use([ 'i18np','jquery'], function () {
        i18np = layui.i18np;
        i18np.loadProperties(moduleName);
    });

    var wifiData = {};
    function wifiDataInit(){
        if (defaultLang == "zh") {
            $('#toUse').html(wifiData.toUseZh);
        } else if (defaultLang == "la") {
            $('#toUse').html(wifiData.toUseLao);
        } else if (defaultLang == "en") {
            $('#toUse').html(wifiData.toUseEn);
        }
    }

    $(function (){
        search();
    })
    function search() {
        $.ajax({
            url: HOST+"webapi/wifi/getWifi",
            type: "GET",
            success: function (res) {
                $("#pic_bac02").attr("src", res.data.picture);
                $('#number').html(res.data.number);
                $('#content').html(res.data.content);
                $('#detail').html("");
                wifiData = res.data;
                wifiDataInit();
            }
        })
        $.ajax({
            url: HOST + "webapi/wifi/getWifiComboByPage?limit=5&page=1&type=1",
            type: "GET",
            success: function (res) {
                var trRow = res.data;
                var str1 = "";
                for (var i = 0; i < trRow.length; i++) {
                    str1 += "<tr>" + "<td>" + trRow[i].taocan + "</td>" +
                        "<td>" + trRow[i].ka + "</td>" +
                        "<td>" + trRow[i].hour + "</td>" +
                        "</tr>";
                }
                test.innerHTML = str1;
            }
        })
        $.ajax({
            url: HOST + "webapi/wifi/getWifiComboByPage?limit=5&page=1&type=2",
            type: "GET",
            success: function (res) {
                var trRow = res.data;
                var str1 = "";
                for (var i = 0; i < trRow.length; i++) {
                    str1 += "<tr>" + "<td>" + trRow[i].ka + "</td>" +
                        "<td>" + trRow[i].hour + "</td>" +
                        "<td>" + trRow[i].day + "</td>" +
                        "</tr>";
                }
                test2.innerHTML = str1;
            }
        })
    }

</script>
</body>
</html>